package org.soft.xinyu.equipmentmanagement.controller;


import org.soft.xinyu.equipmentmanagement.entity.MachineFile;
import org.soft.xinyu.equipmentmanagement.service.MachineFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author vicente
 * @since 2021-11-22
 */
@RestController
@RequestMapping("/machine-file")
public class MachineFileController {

    @Autowired
    private MachineFileService machineFileService;

    /**
     * 上传文件
     *
     * @return
     */
    @PostMapping("/uploadMachineFile")
    public Object uploadMachineFile() {
        //上传文件返回路径名称等等
        machineFileService.uploadMachineFile();
        return new Object();
    }

    @DeleteMapping("/deleteMachineFileAndRecord")
    public Boolean deleteMachineFileAndRecord (@RequestBody MachineFile machineFile) {
        boolean b = machineFileService.deleteMachineFileById(machineFile);
        return b;
    }
}
